<?php 
class Catalog_model extends CI_Model {
public $table_name="catalog";
	  public function get_all(){
		$query=$this->db->get($this->table_name);
	   return $query->result();

}
   public function delete($id){
   	$this->db->delete($this->table_name, array('id' => $id));
   }
    public function add_one($data){
	$this->db->insert($this->table_name, $data);

}

  public function edit_one($id,$data){
		$this->db->where('id', $id);
       $this->db->update($this->table_name, $data);
		
		
 }
 public	function get_one($id){
		$query=$this->db->where("id",$id)->get($this->table_name);
	   return $query->row();

	}
}
?>

